/*
 * $Id: FileInfo.java,v 1.1 2009/08/11 13:23:33 oliver Exp $
 * 
 * Copyright (C) 2009 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.ui.pojo;

import java.io.File;
import java.util.Date;

import com.ge.healthcare.autosc.common.ASCUtil;
import com.ge.healthcare.autosc.common.util.TimeFormatStandard;

public class FileInfo extends AscUiObject implements TimeSortableI {
	private String name;
	private String directory;
	private String cdate;
	private Long time;
	private Long size;

	public FileInfo() {

	}

	public FileInfo(File file) {
		this.setName(file.getName());
		this.setDirectory(file.getAbsolutePath());
		this.setTime(file.lastModified());
		if (ASCUtil.isNullOrEmptyObject(file.lastModified())
				|| file.lastModified() > 0L) {
			this.setCdate(TimeFormatStandard.format(new Date(file
					.lastModified())));
		}
		this.setSize(file.length());
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the directory
	 */
	public String getDirectory() {
		return directory;
	}

	/**
	 * @param directory
	 *            the directory to set
	 */
	public void setDirectory(String directory) {
		this.directory = directory;
	}

	/**
	 * @return the cdate
	 */
	public String getCdate() {
		return cdate;
	}

	/**
	 * @param cdate
	 *            the cdate to set
	 */
	public void setCdate(String cdate) {
		this.cdate = cdate;
	}

	/**
	 * @return the time
	 */
	public Long getTime() {
		return time;
	}

	/**
	 * @param time
	 *            the time to set
	 */
	public void setTime(Long time) {
		this.time = time;
	}

	/**
	 * @return the size
	 */
	public Long getSize() {
		return size;
	}

	/**
	 * @param size
	 *            the size to set
	 */
	public void setSize(Long size) {
		this.size = size;
	}
}
